<?php
	include_once("conn.php");

	$name1 = $_POST["obj1"];
	$addr1 = $_POST["obj2"];
	$cid1 = $_POST["obj3"];

	$query = "insert into link(webname,webaddress) value('".$name1."','".$addr1."')";
	$query2 = "select distinct lid from link where webname='".$name1."' order by `lid` desc LIMIT 1";
	mysql_query($query);
	$result2 = mysql_query($query2);
	while( $got_result2  = mysql_fetch_array($result2) )
	{
		$got_lid=$got_result2["lid"];
	}
	$query3 = "insert into cate_link(cid,lid) values('".$cid1."','".$got_lid."')";
	mysql_query($query3);
	
	$lid1 = $got_lid;

	echo json_encode($name1);
	echo json_encode($addr1);
	echo json_encode($lid1);
	


?>